﻿using System;
using System.Linq;
using System.Collections;
using System.ComponentModel;
using System.ServiceProcess;
using System.Collections.Generic;
using System.Configuration.Install;

namespace Cratos.Server.WinService
{
	/// <summary>
	/// Surveillance Windows Service Installer class
	/// </summary>
	[RunInstaller(true)]
	public partial class CratosWinServiceInstaller : Installer
	{
		#region Class Constant declarations
		#endregion

		#region Class Event declarations
		#endregion

		#region Class Variable declarations
		private ServiceInstaller				surveillanceInstaller;
		private ServiceProcessInstaller	processInstaller;
		#endregion

		#region Class Constructors & Destructors
		/// <summary>
		/// Class Constructor
		/// </summary>
		public CratosWinServiceInstaller()
		{
			// Initialize the relevant component(s)
			InitializeComponent();

			// Instantiate installers for process(es) and service(s)
			this.processInstaller      = new ServiceProcessInstaller();
			this.surveillanceInstaller = new ServiceInstaller();

			// Set the Account
			this.processInstaller.Account = ServiceAccount.LocalSystem;

			// Setup the Message Handler Service appropriately
			this.surveillanceInstaller.StartType   = ServiceStartMode.Automatic;
			this.surveillanceInstaller.ServiceName = "Cratos Service";
			this.surveillanceInstaller.DisplayName = "Cratos Service";

			// Add Installers to collection
			this.Installers.Add(this.surveillanceInstaller);
			this.Installers.Add(this.processInstaller);
		}
		#endregion

		#region Class Properties
		#endregion

		#region Class Methods
		#endregion

		#region Class Support Methods
		#endregion
	}
}
